package cn.cljh.day9_19.pojo;

import java.util.Date;
import java.util.Objects;

public class Login {
    private int id;
    private String username;
    private String password;
    private int role;
    private  int status;
    private Date createTime;

    public Login( String username, String  password, int role, int status) {
        this.username = username;
        this.password = password;
        this.role = role;
        this.status = status;
    }

    public Login(int id, String username, String password, int role, int status, Date createTime) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.role = role;
        this.status = status;
        this.createTime = createTime;
    }

    public Login() {
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String  password) {
        this.password = password;
    }

    public int getRole() {
        return role;
    }

    public void setRole(int role) {
        this.role = role;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Login)) return false;
        Login login = (Login) o;
        return getId() == login.getId() && getPassword() == login.getPassword() && getRole() == login.getRole() && getStatus() == login.getStatus() && Objects.equals(getUsername(), login.getUsername()) && Objects.equals(getCreateTime(), login.getCreateTime());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getId(), getUsername(), getPassword(), getRole(), getStatus(), getCreateTime());
    }

    @Override
    public String toString() {
        return id+"\t"+username+"\t"+password+"\t"+role+"\t"+status+"\t"+createTime;
    }
}
